package com.automobile.backstage.service.impl;


import com.automobile.backstage.dao.MakeAppDao;
import com.automobile.backstage.domain.MakeApp;
import com.automobile.backstage.service.MakeAppService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("makeAppService")
public class MakeAppServiceImpl implements MakeAppService {

	@Autowired
    private MakeAppDao makeAppDao;
	
	public void save(MakeApp makeApp) {
		makeAppDao.save(makeApp);
	}

    @Override
    public List<MakeApp> findAll(Integer page, Integer size) throws Exception {
        PageHelper.startPage(page,size);
        return makeAppDao.findAll();
    }

    @Override
    public MakeApp findMakeAppById(Integer id) throws Exception {
        return makeAppDao.findMakeAppById(id);
    }

    @Override
    public void del(List<Integer> ids) throws Exception {
        for(Integer id:ids){
            makeAppDao.del(id);
        }
    }

}
